Smartphone-delivered automated treatment